package com.leng.asynchronous.controller;


import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@RabbitListener(queues  = "myQueue")
@Component
@Slf4j
public class RabbitController {

    @RabbitHandler
    public void process(String hello){
        System.out.println("Receiver:" + hello);
        log.error("Receiver:"+hello);
    }

    @RabbitHandler
    public void process(Integer hello){
        System.out.println("Receiver:" + hello);
        log.error("Receiver:"+hello);
    }
}
